package org.example.java8;

public class FunctionRef {
    public static void main(String[] args) {
        InterfaceExample com = Example::new;
//        InterfaceExample com = name -> new Example(name);
        Example bean = com.create("hello world");
        System.out.println(bean.name);
    }
}

class Example {
    public String name;

    Example(String name) {
        this.name = name;
    }
}

interface InterfaceExample {
    Example create(String name);
}
